package com.transaction.manage.localMapper;

import com.transaction.manage.model.dto.Dict;
import com.transaction.manage.model.vo.ComboboxVo;
import com.transaction.manage.myMapper.MyMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface DictMapper extends MyMapper<Dict> {

    @Select("SELECT dict_key AS value, CONCAT(dict_key,'(',dict_value,')') AS label FROM dict WHERE parent_code = ( SELECT CODE FROM dict t WHERE t.dict_key = #{key} AND show_flag = 1 ) AND show_flag = 1 ")
    List<ComboboxVo> selectAllChildrenByDictKey(String key);
}